<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>课程信息表</title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<link rel="shortcut icon" href="images/logo.jpg">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>

</head>

<body>

  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">课程信息表</strong> </div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
      <li><a href="page/instructor/course_add.jsp" class="button border-main icon-search" onclick="changesearch()" > 添加课程</a></li>
        <form action="page/instructor/course/action_searchcourse.jsp" method="post">
        <li>按课程编号查询：</li>     
        <li><input type="text" placeholder="请输入搜索关键字" name="courseID" class="input" style="width:250px; line-height:17px;display:inline-block" value="0102"/>
        <input type="submit" value="查询"/></li>
		</form> 
      </ul>
    </div>
   
    <table class="table table-hover text-center">
      <tr>
       			<th>序号</th>
				<th>课程编号</th>
				<th>班号</th>
				<th>课程名称</th>
				<th>学年</th>
				<th>学期</th>
				<th>学时</th>
				<th>操作</th>
				
      </tr>
    
				
				
			
			<% 
			    request.setCharacterEncoding("utf-8");
			  
			    String  keyword=request.getParameter("keyword");
			
				StringBuffer sqlBuff = new StringBuffer();
				sqlBuff.append("select * from sys_course limit 0,6");
				String sql = sqlBuff.toString();
				
				Connection conn = getConn();
			
				PreparedStatement pstmt = conn.prepareStatement(sql);

				ResultSet rs = pstmt.executeQuery();
				
				int index = 1;
				while (rs.next()) {
					
				String courseID=rs.getNString("courseID");
				String classID=rs.getNString("classID");							
				String courseName=rs.getNString("courseName");			
				String year=rs.getNString("year");
				String term=rs.getNString("term");
				String hour=rs.getString("hour");
			%>

			<tr>
				 <td><%=index++ %></td>
				<td><%=courseID%></td>
				<td><%=classID%></td>
				<td><%=courseName %></td>
				<td><%=year%></td>
				<td><%=term %></td>				
				<td><%=hour%></td>
				<td><div class="button-group">
				 <a class="button border-main" href="<%=path%>/page/instructor/course/course_edit.jsp?courseID=<%=courseID%>"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="<%=path%>/page/instructor/course/action_delcourse.jsp?courseID=<%=courseID%>" ><span class="icon-trash-o"></span> 删除</a>  </div></td>
			</tr>
			<%
				}
			%>
    </table>
  </div>
  <div class="pagelist"><span class="current"> <a href="page/instructor/course/course_list.jsp">上一页</a></span> <span class="current"><a href="page/instructor/course/course_list.jsp">1</a></span><span class="current"><a href="page/instructor/course/course_page2.jsp">2</a></span><span class="current"><a href="page/instructor/course/course_page3.jsp">3</a></span><span class="current"><a href="page/instructor/course/course_page2.jsp">下一页</a></span><span class="current"><a href="page/instructor/course/course_page3.jsp">尾页</a></span> </div>

</body>
</html>
